//
//  NumverConverter.swift
//  clt
//
//  Created by Mars on 2020/9/13.
//

import Foundation

func converter(_ n: Int, radix: Int) -> String? {
  guard radix == 2 || radix == 16 else {
    return nil
  }
  
  var result = ""
  
  if radix == 2 {
    // ...

  }
  else {
    // ...

  }
  
  return result
}

func decimalToBinary(_ n: Int) -> String {
  return converter(n, radix: 2) ?? ""
}

func decimalToHex(_ n: Int) -> String {
  return converter(n, radix: 16) ?? ""
}


